﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="Views.ViewCalculDetaillesModel2"
	
	d:DesignWidth="640" d:DesignHeight="480">

    <Grid Name="simpleGrd" Grid.Row="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="Colonnes Affichées" Margin="50,0,0,0" VerticalAlignment="Center" Visibility="Collapsed" />
            <ComboBox HorizontalAlignment="Left" Margin="5" MinWidth="150" VerticalAlignment="Center" ItemsSource="{Binding Columns, ElementName=simpleDataGrid, Mode=OneWay}" Style="{DynamicResource OMANE_cbx}" IsTabStop="False" Text="Colonnes Affichées" SelectedIndex="0" IsTextSearchEnabled="False" Visibility="Collapsed" >
                <ComboBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ComboBoxItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                                    <CheckBox Content="{Binding Header, Mode=OneWay}" Padding="5,1,1,1" VerticalContentAlignment="Center" VerticalAlignment="Center" Margin="0,1" FontWeight="Bold" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" IsChecked="True" />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ComboBox.ItemContainerStyle>
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="Colonnes Affichées" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <TextBlock Text="Filtre" Margin="50,0,0,0" VerticalAlignment="Center" Visibility="Collapsed" />
            <CheckBox HorizontalAlignment="Left"   Margin="5,0,0,0" VerticalAlignment="Center" HorizontalContentAlignment="Stretch" x:Name="simpleFilterCheckBox" IsThreeState="False" Visibility="Collapsed" />
            <TextBox FontWeight="Bold" x:Name="simpleFilterTextBox" HorizontalAlignment="Left" MinWidth="150" IsEnabled="{Binding IsChecked, ElementName=simpleFilterCheckBox, Mode=OneWay}" AutoWordSelection="True" AllowDrop="False" IsTabStop="False" Visibility="Collapsed"  />
            <Button Content=". . ."  Style="{StaticResource btnBase_OMANE}" x:Name="simpleBtnFilter" Width="25" Height="25" VerticalAlignment="Center" Margin="5,0,0,0" IsEnabled="{Binding IsChecked, ElementName=simpleFilterCheckBox, Mode=OneWay}" Visibility="Collapsed" />
            <Button Content="Ajouter une colonne calculée" Margin="50,0,0,0" Style="{StaticResource btnBase_OMANE}" x:Name="simpleBtnComputedColumn" Width="Auto" Visibility="Collapsed" />
            <Button Content="Options Avancees"  Margin="50,5,0,5" Style="{StaticResource btnBase_OMANE}" Name="AdvancedOptions" Width="150" />
            <Button Content="Cacher toutes les colonnes"  Margin="50,5,0,5" Style="{StaticResource btnBase_OMANE}" Name="HideShowAll" Width="166" />

        </StackPanel>

        <DataGrid xml:lang="fr-FR" ItemsSource="{Binding FinalTable}" Name="simpleDataGrid" CanUserAddRows="False" CanUserDeleteRows="False" Grid.RowSpan="2" Grid.Row="1" AlternatingRowBackground="#FFC4C4C4" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" IsReadOnly="True" Focusable="False" AlternationCount="1" ClipboardCopyMode="IncludeHeader" ColumnHeaderStyle="{DynamicResource DataGridColumnHeaderStyle}">
            <DataGrid.Resources>
                <Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
                    <Setter Property="HorizontalContentAlignment" Value="Right"/>
                    <Setter Property="VerticalContentAlignment" Value="Center"/>
                    <Setter Property="HorizontalAlignment" Value="Right"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="IsTabStop" Value="False"/>
                    <Setter Property="Focusable" Value="False"/>
                </Style>
                <Style x:Key="DataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
                    <Setter Property="ContextMenu">
                        <Setter.Value>
                            <ContextMenu>
                                <MenuItem Header="Cacher"/>
                                <MenuItem Header="Format"/>
                                <MenuItem Header="Filtre"/>
                            </ContextMenu>
                        </Setter.Value>
                    </Setter>
                </Style>
            </DataGrid.Resources>

            <DataGrid.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Grouper" Click="SimpleGrd_Grouper_Click"/>
                    <MenuItem Header="Degrouper" Click="SimpleGrd_DeGrouper_Click"/>
                </ContextMenu>
            </DataGrid.ContextMenu>

        </DataGrid>
    </Grid>
</UserControl>